\(\int \frac {a+a x+c x^2}{1-x^3} \, dx\) [48]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 32 \[ \int \frac {a+a x+c x^2}{1-x^3} \, dx=-\frac {1}{3} (2 a+c) \log (1-x)+\frac {1}{3} (a-c) \log \left (1+x+x^2\right ) \]

[Out]

-1/3*(2*a+c)*ln(1-x)+1/3*(a-c)*ln(x^2+x+1)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {1889, 31, 642} \[ \int \frac {a+a x+c x^2}{1-x^3} \, dx=\frac {1}{3} (a-c) \log \left (x^2+x+1\right )-\frac {1}{3} (2 a+c) \log (1-x) \]

[In]

Int[(a + a*x + c*x^2)/(1 - x^3),x]

[Out]

-1/3*((2*a + c)*Log[1 - x]) + ((a - c)*Log[1 + x + x^2])/3

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 1889

Int[(P2_)/((a_) + (b_.)*(x_)^3), x_Symbol] :> With[{A = Coeff[P2, x, 0], B = Coeff[P2, x, 1], C = Coeff[P2, x,
 2], q = (-a/b)^(1/3)}, Dist[q*((A + B*q + C*q^2)/(3*a)), Int[1/(q - x), x], x] + Dist[q/(3*a), Int[(q*(2*A -
B*q - C*q^2) + (A + B*q - 2*C*q^2)*x)/(q^2 + q*x + x^2), x], x] /; NeQ[a*B^3 - b*A^3, 0] && NeQ[A + B*q + C*q^
2, 0]] /; FreeQ[{a, b}, x] && PolyQ[P2, x, 2] && LtQ[a/b, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{3} \int \frac {a-c+(2 a-2 c) x}{1+x+x^2} \, dx+\frac {1}{3} (2 a+c) \int \frac {1}{1-x} \, dx \\ & = -\frac {1}{3} (2 a+c) \log (1-x)+\frac {1}{3} (a-c) \log \left (1+x+x^2\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.97 \[ \int \frac {a+a x+c x^2}{1-x^3} \, dx=\frac {1}{3} \left (-((2 a+c) \log (1-x))+(a-c) \log \left (1+x+x^2\right )\right ) \]

[In]

Integrate[(a + a*x + c*x^2)/(1 - x^3),x]

[Out]

(-((2*a + c)*Log[1 - x]) + (a - c)*Log[1 + x + x^2])/3

Maple [A] (verified)

Time = 1.72 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.88

method result size
default \(\left (-\frac {2 a}{3}-\frac {c}{3}\right ) \ln \left (-1+x \right )+\frac {\left (a -c \right ) \ln \left (x^{2}+x +1\right )}{3}\) \(28\)
norman \(\left (-\frac {2 a}{3}-\frac {c}{3}\right ) \ln \left (-1+x \right )+\left (\frac {a}{3}-\frac {c}{3}\right ) \ln \left (x^{2}+x +1\right )\) \(29\)
parallelrisch \(-\frac {2 \ln \left (-1+x \right ) a}{3}-\frac {\ln \left (-1+x \right ) c}{3}+\frac {\ln \left (x^{2}+x +1\right ) a}{3}-\frac {\ln \left (x^{2}+x +1\right ) c}{3}\) \(36\)
risch \(-\frac {2 \ln \left (-1+x \right ) a}{3}-\frac {\ln \left (-1+x \right ) c}{3}+\frac {\ln \left (-x^{2}-x -1\right ) a}{3}-\frac {\ln \left (-x^{2}-x -1\right ) c}{3}\) \(44\)
meijerg \(-\frac {c \ln \left (-x^{3}+1\right )}{3}-\frac {a \,x^{2} \left (\ln \left (1-\left (x^{3}\right )^{\frac {1}{3}}\right )-\frac {\ln \left (1+\left (x^{3}\right )^{\frac {1}{3}}+\left (x^{3}\right )^{\frac {2}{3}}\right )}{2}+\sqrt {3}\, \arctan \left (\frac {\sqrt {3}\, \left (x^{3}\right )^{\frac {1}{3}}}{2+\left (x^{3}\right )^{\frac {1}{3}}}\right )\right )}{3 \left (x^{3}\right )^{\frac {2}{3}}}-\frac {a x \left (\ln \left (1-\left (x^{3}\right )^{\frac {1}{3}}\right )-\frac {\ln \left (1+\left (x^{3}\right )^{\frac {1}{3}}+\left (x^{3}\right )^{\frac {2}{3}}\right )}{2}-\sqrt {3}\, \arctan \left (\frac {\sqrt {3}\, \left (x^{3}\right )^{\frac {1}{3}}}{2+\left (x^{3}\right )^{\frac {1}{3}}}\right )\right )}{3 \left (x^{3}\right )^{\frac {1}{3}}}\) \(138\)

[In]

int((c*x^2+a*x+a)/(-x^3+1),x,method=_RETURNVERBOSE)

[Out]

(-2/3*a-1/3*c)*ln(-1+x)+1/3*(a-c)*ln(x^2+x+1)

Fricas [A] (verification not implemented)

none

Time = 0.49 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.81 \[ \int \frac {a+a x+c x^2}{1-x^3} \, dx=\frac {1}{3} \, {\left (a - c\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{3} \, {\left (2 \, a + c\right )} \log \left (x - 1\right ) \]

[In]

integrate((c*x^2+a*x+a)/(-x^3+1),x, algorithm="fricas")

[Out]

1/3*(a - c)*log(x^2 + x + 1) - 1/3*(2*a + c)*log(x - 1)

Sympy [A] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.75 \[ \int \frac {a+a x+c x^2}{1-x^3} \, dx=\frac {\left (a - c\right ) \log {\left (x^{2} + x + 1 \right )}}{3} - \frac {\left (2 a + c\right ) \log {\left (x - 1 \right )}}{3} \]

[In]

integrate((c*x**2+a*x+a)/(-x**3+1),x)

[Out]

(a - c)*log(x**2 + x + 1)/3 - (2*a + c)*log(x - 1)/3

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.81 \[ \int \frac {a+a x+c x^2}{1-x^3} \, dx=\frac {1}{3} \, {\left (a - c\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{3} \, {\left (2 \, a + c\right )} \log \left (x - 1\right ) \]

[In]

integrate((c*x^2+a*x+a)/(-x^3+1),x, algorithm="maxima")

[Out]

1/3*(a - c)*log(x^2 + x + 1) - 1/3*(2*a + c)*log(x - 1)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.84 \[ \int \frac {a+a x+c x^2}{1-x^3} \, dx=\frac {1}{3} \, {\left (a - c\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{3} \, {\left (2 \, a + c\right )} \log \left ({\left | x - 1 \right |}\right ) \]

[In]

integrate((c*x^2+a*x+a)/(-x^3+1),x, algorithm="giac")

[Out]

1/3*(a - c)*log(x^2 + x + 1) - 1/3*(2*a + c)*log(abs(x - 1))

Mupad [B] (verification not implemented)

Time = 9.46 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.09 \[ \int \frac {a+a x+c x^2}{1-x^3} \, dx=\frac {a\,\ln \left (x^2+x+1\right )}{3}-\frac {c\,\ln \left (x-1\right )}{3}-\frac {2\,a\,\ln \left (x-1\right )}{3}-\frac {c\,\ln \left (x^2+x+1\right )}{3} \]

[In]

int(-(a + a*x + c*x^2)/(x^3 - 1),x)

[Out]

(a*log(x + x^2 + 1))/3 - (c*log(x - 1))/3 - (2*a*log(x - 1))/3 - (c*log(x + x^2 + 1))/3